// index.js
// 获取应用实例
const app = getApp()

Page({
  data: {
   swiper:[],
   cate:[],
   louceng:[]
  },
  onLoad(){
    this.getSwiper()
    this.getCate()
    this.getList()
  },
  getSwiper(){
    wx.request({
      url: 'https://api-hmugo-web.itheima.net/api/public/v1/home/swiperdata',
      success:res=>{
        // console.log(res);
        this.setData({
          swiper:res.data.message
      })
      }
    })
  },
  getCate(){
    wx.request({
      url: 'https://api-hmugo-web.itheima.net/api/public/v1/home/catitems',
      success:res=>{
        // console.log(res);
        this.setData({
          cate:res.data.message
        })
      }
    })
  },
  getList(){
    wx.request({
      url: 'https://www.uinav.com/api/public/v1/home/floordata',
      success:res=>{
        console.log(res);
        this.setData({
          louceng:res.data.message
        })
      }
    })
  },
  search(){
    wx.navigateTo({
      url: '/pages/search/search',
    })
  }
  // 事件处理函数
  
})
